package com.neusoft.bizcore.notice.notification.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@Entity
@Table(name = "neuiot_notice_record_mail")
public class NoticeRecordMail extends SendMsgStatus {

    private static final long serialVersionUID = 6364872538917788458L;
    /** 以逗号分隔的收件人地址 */
    @Length(max = 1023, message = "收件人地址不能超过{max}位")
    @Column(length = 1023, nullable = true)
    String emailAddress;

    /** 模板名称 */
    @Length(max = 1023, message = "模板名称不能超过{max}位")
    @Column(length = 1023, nullable = true)
    String templateName;

    @Length(max = 2047, message = "内容不能超过{max}位")
    @Column(length = 2047, nullable = true)
    String templateMsg;

    @OneToOne(targetEntity = NoticeRecord.class, mappedBy = "mail")
    private NoticeRecord record;
}
